package com.liang.exception;

/**
 * @author 梁伟浩
 * @date 2023/8/5 20:52
 * @study 星期六
 */
public class studyTryCatch {

    public static void main(String[] args) {
        try {
            Integer.parseInt("1");
            //finally一样会被执行
            return;
            //同时catch补抓多种异常
        }catch (NumberFormatException | NullPointerException e){
            System.out.println("异常啦！！！！！！！"+e.getMessage());
            e.printStackTrace();

        }finally {
            System.out.println("finally无论是否异常都会被执行");
        }
        System.out.println("最后打印程序！");
    }
}
